home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / nannws35.zip / HORIMENU.PRG < prev    next >
Text File  |  1989-03-01  |  1KB  |  61 lines

  1. * Program: Horimenu.prg
  2. * Author:  Don L. Powells
  3. * Version: Clipper Summer '87
  4. * Note(s): Demonstrates horizontal light-bar movement with
  5. *          SET KEY, @..PROMPT and MENU TO.
  6. *
  7. *          The left and right arrow keys are set to functions
  8. *          which stuff the keyboard with the number of arrow
  9. *          keys equal to the height of a menu column.
  10. *
  11. * Copyright (c) 1989 Nantucket Corporation.
  12.  
  13. * Display screen constants.
  14. CLEAR SCREEN
  15. @ 1,15 SAY " Testing Menu w/ Horizontal Movement"
  16. @ 3,23 TO 9,42
  17. @ 11,15 SAY " Press <ESC> to exit this program. "
  18.  
  19. * Assign right and left arrow keys to user-defined functions.
  20. SET KEY 4 TO Rtarrow
  21. SET KEY 19 TO Ltarrow
  22.  
  23. * Show menu.
  24. SET WRAP ON
  25. choice = 1
  26. DO WHILE choice != 0
  27.    @ 5,25 PROMPT "Opt 1"
  28.    @ 6,25 PROMPT "Opt 2"
  29.    @ 7,25 PROMPT "Opt 3"
  30.    @ 5,35 PROMPT "Opt 4"
  31.    @ 6,35 PROMPT "Opt 5"
  32.    @ 7,35 PROMPT "Opt 6"
  33.    MENU TO choice
  34.  
  35.    @ 13,5
  36.    @ 13,5 SAY "Option " + LTRIM(STR(choice)) + " was chosen."
  37.    WAIT
  38.    @ 13,5
  39.    @ 14,0
  40. ENDDO
  41. RETURN
  42.  
  43. * Rtarrow()
  44. * Stuffs the keyboard with three down arrows when the right arrow
  45. * key is pressed.
  46. *
  47. FUNCTION Rtarrow
  48. KEYBOARD REPLICATE(CHR(24),3)
  49. RETURN(.T.)
  50.  
  51.  
  52. * Ltarrow()
  53. * Stuffs the keyboard with three up arrows when the left arrow key
  54. * is pressed.
  55. *
  56. FUNCTION Ltarrow
  57. KEYBOARD REPLICATE(CHR(5),3)
  58. RETURN(.T.)
  59.  
  60. * EOF: Horimenu.prg
  61.